#include "flabbybox.h"

struct menu_entry
{
	char			*label;
	void			(*action)(char *);
	char			*args;

	struct menu_entry	*up;
	struct menu_entry	*down;

};

struct menu
{
	char 			*name;
	struct menu		*prev;

	struct menu		*back;
	struct menu_entry	*entries;
	struct menu_entry	*pointer;
};

struct menu *find_menu(struct menu *p, char *menuname);
struct menu *add_menu (struct menu *previous, char *name);
void add_menu_entry(struct menu *mymenu, char *entrylabel, void(*entryaction)(char*), char *entryargs);
void display_menu(struct menu *mymenu);
bool extract_menu_entry(struct menu *p, char *buf, struct flabbybox_funcs *func_map);

